﻿using HISModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using Newtonsoft.Json;
namespace server_side
{
    /// <summary>
    /// WebService1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        /// <summary>
        /// 管理员登录方法
        /// </summary>
        /// <param name="T_Admin"></param>
        /// <returns></returns>
        public List<T_Control> T_Admin()
        {
            var s = JsonConvert.SerializeObject(new HISBLL.log_inbll().T_Admin());
            var list = JsonConvert.DeserializeObject<List<T_Control>>(s);
            return list;
        }
        [WebMethod]
        /// <summary>
        /// 普通登录方法
        /// </summary>
        /// <param name="T_Admin"></param>
        /// <returns></returns>
        public List<T_Control> T_User()
        {
            var s = JsonConvert.SerializeObject(new HISBLL.log_inbll().T_User());
            var list = JsonConvert.DeserializeObject<List<T_Control>>(s);
            return list;
        }
        [WebMethod]
        /// <summary>
        /// 查询角色数据
        /// </summary>
        /// <returns></returns>
        public List<T_Role> getdatatble()
        {
            return new HISBLL.log_inbll().getdatatble();
        }
        [WebMethod]
        /// <summary>
        /// 管理员添加方法
        /// </summary>
        /// <param name="T_Admin"></param>
        /// <returns></returns>
        public int appendAdmin(string Admin_Name, string Admin_Pwd, int Role_ID)
        {
            return new HISBLL.log_inbll().appendAdmin(Admin_Name, Admin_Pwd, Role_ID);
        }
        [WebMethod]
        /// <summary>
        /// 医院数据、单挑、全部
        /// </summary>
        /// <param name="id">单挑查询的医院ID值</param>
        /// <returns></returns>
        public userinfos<T_Hospital> T_Hospitalfenye(int pageindex, int pagesize, string Hosp_ID, string T_Hospital)
        {
            return new HISBLL.log_inbll().T_Hospitalfenye(pageindex, pagesize, Hosp_ID, T_Hospital);
        }
        [WebMethod]
        /// <summary>
        /// 普通添加方法
        /// </summary>
        /// <param name="T_Admin"></param>
        /// <returns></returns>
        public int append(string U_Name, string U_Pwd, string U_Sex, int U_Age, string U_Phone, string U_IdCard)
        {
            return new HISBLL.log_inbll().append(U_Name, U_Pwd, U_Sex, U_Age, U_Phone, U_IdCard);
        }
        [WebMethod]
        /// <summary>
        /// 权限数据
        /// </summary>
        /// <returns></returns>
        public List<T_Control> T_Control(int id)
        {
            return new HISBLL.log_inbll().T_Control(id);
        }
        [WebMethod]
        //添加科室信息
        public int AddOffice(T_Office m)
        {
            return new HISBLL.OfficeBll().AddOffice(m);
        }
        [WebMethod]
        //获取科室信息
        public List<T_Office> SelectOff(string name)
        {
            return new HISBLL.OfficeBll().SelectOff(name);
        }
        [WebMethod]
        //删除科室信息
        public int DelOffice(int id)
        {
            return new HISBLL.OfficeBll().DelOffice(id);
        }
<<<<<<< .mine

||||||| .r32
<<<<<<< .mine
=======
>>>>>>> .r33
        [WebMethod]
        //获取医院下拉列表的数据
        public List<T_Hospital> GetDataHospital()
        {
            return new HISBLL.ghBLL().GetDataHospital();
        }
        [WebMethod]
        //获取科室下拉列表的数据
        public List<T_Office> GetDataOffice()
        {
            return new HISBLL.ghBLL().GetDataOffice();
        }
        [WebMethod]
        //获取医生下拉列表的数据
        public List<T_Doctor> GetDataDoctor()
        {
            return new HISBLL.ghBLL().GetDataDoctor();
        }
        [WebMethod]
        //添加挂号信息
        public int GetDataGHinfo(Gh_Table m)
        {
            return new HISBLL.ghBLL().GetDataGHinfo(m);
        }
        [WebMethod]
        /// <summary>
        /// 添加、修改医院信息
        /// </summary>
        /// <param name="Hosp"></param>
        /// <returns></returns>
        public int T_Hospital_Add(T_Hospital Hosp)
        {
            return new HISBLL.log_inbll().T_Hospital_Add(Hosp);
        }
        [WebMethod]
        /// <summary>
        /// 科室数据
        /// </summary>
        /// <returns></returns>
        public List<T_Office> T_Office()
        {
            return new HISBLL.log_inbll().T_Office();
        }
        [WebMethod]
        /// <summary>
        /// 删除医院信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int T_Hospital_Del(int id)
        {
            return new HISBLL.log_inbll().T_Hospital_Del(id);
        }
        [WebMethod]
        public List<T_Hospital> T_Hospital(string id)
        {
            return new HISBLL.log_inbll().T_Hospital(id);
        }
        [WebMethod]
        /// <summary>
        /// 科室分页查询
        /// </summary>
        /// <param name="id">单挑查询的医院ID值</param>
        /// <returns></returns>
        public T_Officeuserinfos<T_Office> T_Officefenye(int pageindex, int pagesize, string Office_ID, string T_Office)
        {
            return new HISBLL.OfficeBll().T_Officefenye(pageindex, pagesize, Office_ID, T_Office);
        }
        [WebMethod]
        /// <summary>
        /// 医生分页数据查询
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <param name="Doctor_ID"></param>
        /// <param name="T_Doctor"></param>
        /// <returns></returns>
        public T_Doctoruserinfos<T_Doctor> T_Doctorfenye(int pageindex, int pagesize, string Doctor_ID, string T_Doctor)
        {
            return new HISBLL.log_inbll().T_Doctorfenye(pageindex, pagesize, Doctor_ID, T_Doctor);
        }
        [WebMethod]
        //获取医生级别下拉列表的数据
        public List<T_DoctorType> GetDatajibie()
        {
            return new HISBLL.ghBLL().GetDatajibie();
        }

        HISBLL.DoctorBLL bll = new HISBLL.DoctorBLL();
        /// <summary>
        /// 显示当前登录医生
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        [WebMethod]
        public List<T_Doctor> ShowInfo(string name)
        {
            return bll.ShowInfo(name);
        }
        /// <summary>
        /// 显示挂号当前医生的病人
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        [WebMethod]
        public List<Gh_Table> ShowghInfo(string name)
        {
            return bll.ShowghInfo(name);
        }
<<<<<<< .mine

||||||| .r32
>>>>>>> .r30
=======
>>>>>>> .r33
    }
}
